//
//  ThumbData.h
//

#import <Cocoa/Cocoa.h>

//------------------------------------------------------------------------------

// The thumbnail state hasn't been determined yet
#define THUMB_STATE_UNKNOWN			0

// No exif data in the image
#define THUMB_STATE_NO_EXIF			1

// The exif data had no thumbnail
#define THUMB_STATE_NOT_IN_EXIF		2

// The exif data had a thumbnail with the wrong orientation
#define THUMB_STATE_WRONG_EXIF		3

// The exif data had a valid thumbnail
#define THUMB_STATE_VALID_EXIF		4


#define FILE_TYPE_UNKNOWN			0
#define FILE_TYPE_JPEG				1
#define FILE_TYPE_OTHER				2


#define MEDIA_TYPE_UNKNOWN			0
#define MEDIA_TYPE_IMAGE			1
#define MEDIA_TYPE_MOVIE			2

//------------------------------------------------------------------------------

@interface ThumbData : NSObject 
{
	NSImage		*thumbnail;
	int			width;
	int			height;
	int			thumbState;
	int			fileType;
	int			mediaType;

	NSDate		*fileDate;
	NSDate		*exifDate;

	NSSize		imageSize;

	NSString	*fullPath;
	NSString	*name;
	UInt64		fileLength; 
}

//------------------------------------------------------------------------------

- (id)init
	: (NSImage *)image
	fullPath: (NSString *) fullPath
	fileLength: (UInt64) fileLength
	date: (NSDate*) date
	imageSize: (NSSize) imageSize
	thumbState:(int) tState;

- (id)initWithFilename: (NSString *) fullPath;

- (void) setFileDate:(NSDate*) date;
- (void) setExifDate:(NSDate*) date;
- (void) setImageSize: (NSSize) size;
- (void) setThumbnail: (NSImage *) image;
- (void) setThumbstate:(int) state;
- (void) calculateState;

- (BOOL)isEqual:(id)object;

- (NSImage *) thumbnail;
- (NSString *) fullPath;
- (NSString *) name;

// Return the Exif date if it's set, otherwise, return the file date
- (NSDate *) date;
- (NSDate *) fileDate;
- (NSDate *) exifDate;

- (int) fileType;
- (void) setFileType:(int)type;

- (int) mediaType;
- (void) setMediaType:(int)type;

// Return YES if the Exif & File dates match, NO if not. YES is returned
// if there isn't an Exif date.
- (BOOL) doDatesMatch;

- (NSSize) imageSize;
- (UInt64) fileLength; 
- (int) width;
- (int) height;
- (int) thumbState;

@end
